home *** CD-ROM | disk | FTP | other *** search
/ Aminet 13 / Aminet 13 - August 1996.iso / MainActor / LoadMPEG / DEU / LoadMPEG_HAM8.ma < prev    next >
Text File  |  1994-07-01  |  4KB  |  135 lines

  1. /*                                                                        */
  2. /*  LoadMPEG_adpro.ma                                    Alex Kazik 1994  */
  3. /*  LoadMPEG_HAM6.ma                                                      */
  4. /*  LoadMPEG_HAM8.ma          Alle drei ARexx-Scripte sind zum laden von  */
  5. /*                    MPEG-Animationen. Das Script xxx_adpro konvertiert  */
  6. /*                     die Bilder mit hilfe von ADPro auf ein beliebiges  */
  7. /*   Format, dir Dither und Palette Option wird unterstützt. Dir Scripte  */
  8. /*      xxx_HAM* wandeln die Anim ohne ADPro in das HAM6/HAM8 format um.  */
  9. /*                                                                        */
  10. /*   Alle verwendeten Programme zur decodiering der MPEG-Anims sowie der  */
  11. /*   Konvertierung yuv2ppm und ppm2ilbm sind Public-Domain.               */
  12. /*                                                                        */
  13.  
  14. OPTIONS RESULTS
  15.  
  16. address MAINACTOR
  17. printandstoretxt "ALX:MPEG Loader  -  by Alex Kazik 1994"
  18.  
  19. RequestFile "MPEG-File auswählen"
  20. IF RC = 10 THEN 
  21.   call xEXIT 1
  22. mpgfile = RESULT
  23.  
  24. if ( exists(mpgfile) = 0 ) then
  25.   call xexit 6
  26.  
  27. RequestSaveFile "Ziel-File auswählen"
  28. IF RC = 10 THEN 
  29.   call xEXIT 1
  30. newname = RESULT
  31.  
  32. IF exists(newname) then do
  33.   printtxt "ALX:Datei existiert schon, löschen?"
  34.   RequestSaveFile "Datei löschen -> nochmal wählen!"
  35.   IF (RC = 10) | (RESULT ~= newname) then
  36.     call xexit 5
  37.   ADDRESS COMMAND 'delete' newname
  38. end
  39.  
  40. printtxt "ALX:Decodiere MPEG..."
  41. ADDRESS COMMAND 'copy' mpgfile newname || '.mpg'
  42. wbtofront
  43. ADDRESS COMMAND 'MainActor:mpeg/mpeg -d' newname '>CON:'
  44. screentofront
  45. printtxt "ALX:Lösche TEMP."
  46. ADDRESS COMMAND 'delete' newname || '.mpg'
  47. pics=0
  48. picname = newname || pics
  49. if exists(picname || ".Y") = 0 then do
  50.   call xexit 2
  51. end
  52. if exists(picname || ".U") = 0 then do
  53.   call xexit 2
  54. end
  55. if exists(picname || ".V") = 0 then do
  56.   call xexit 2
  57. end
  58. pics=1
  59. picname = newname || pics
  60. if exists(picname || ".Y") = 0 then do
  61.   call xexit 7
  62. end
  63. if exists(picname || ".U") = 0 then do
  64.   call xexit 7
  65. end
  66. if exists(picname || ".V") = 0 then do
  67.   call xexit 7
  68. end
  69. xxx = 1
  70. do while xxx = 1
  71.   pics = pics + 1
  72.   picname = newname || pics
  73.   if exists(picname || ".Y") = 0 then
  74.     xxx = 0
  75.   if exists(picname || ".U") = 0 then
  76.     xxx = 0
  77.   if exists(picname || ".V") = 0 then
  78.     xxx = 0
  79. end
  80. printandstoretxt "ALX:Konnte" pics "Bilder finden."
  81. RequestInteger 352 "Original Bildbreite des MEPGs"
  82. IF RC = 10 THEN 
  83.   call xEXIT 
  84. width=RESULT
  85. RequestInteger 240 "Original Bildhöhe des MPEGs"
  86. IF RC = 10 THEN
  87.   call xEXIT 1
  88. height=RESULT
  89.  
  90. DO i=1 to pics                           
  91.   yuvpic = i - 1
  92.   yuvname = newname || yuvpic
  93.   actualpic=newname || "." || Right("00000" || i, 5)
  94.  
  95.   printtxt "ALX:Konvertiere Bild" i || "/" || pics || ".  (YUV -> PPM)"
  96.   ADDRESS COMMAND 'MainActor:mpeg/cyuv2ppm' yuvname 'T:ppm.TEMP' '-iw' width '-ih' height
  97.   printtxt "ALX:Konvertiere Bild" i || "/" || pics || ".  (PPM -> IFF)"
  98.   ADDRESS COMMAND 'MainActor:mpeg/ppmtoilbm >' || actualpic '-ham8 -hamFORCE' 'T:ppm.TEMP'
  99.   printtxt "ALX:Konvertiere Bild" i || "/" || pics || ".  (lösche TEMP)"
  100.   ADDRESS COMMAND 'delete' yuvname || ".?"
  101. END
  102.  
  103. ADDRESS COMMAND 'delete t:ppm.TEMP'
  104.  
  105. ADDRESS MAINACTOR
  106. GetSPName
  107.  
  108. if (rc = 0) then
  109.   OpenNewProject                         
  110. SetSPLoader "PIC" "IFF"                
  111. LoadProject newname || ".00001" actualpic            
  112.  
  113. CALL xEXIT 0
  114.  
  115.  
  116.  
  117. xexit:
  118. ARG fehler
  119. if (fehler = 0) then
  120.   fehler = "Done."
  121. else if (fehler = 1) then
  122.   fehler = "Die Operation wurde Abgebrochen!"
  123. else if (fehler = 2) then
  124.   fehler = "Fehler beim Dekodieren."
  125. else if (fehler = 5) then
  126.   fehler = "Datei existiert schon."
  127. else if (fehler = 6) then
  128.   fehler = "Datei existiert nicht."
  129. else if (fehler = 7) then
  130.   fehler = "Anim muß min. 2 Bilder enthalten."
  131.  
  132. address MAINACTOR
  133. Screentofront
  134. PrintAndStoreTxt "ALX:" || fehler
  135. exit